Set-ExecutionPolicy bypass

$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
  
 if ($snapin -eq $null) {
   Write-Host "Loading SharePoint Powershell Snap-in"
   Add-PSSnapin "Microsoft.SharePoint.Powershell"
 }

$scriptPath = $MyInvocation.MyCommand.Path;
$folderPath = Split-Path -parent $scriptPath
$parentPath = (get-item $folderPath).parent.FullName;
#Write-Host $parentPath
$batPath = $parentPath + "\Riolinx.SocialConnekt.ManageTrustedLoginProvider\bin\DeleteSocialConnekt.bat"
Write-Host $batPath
#start-process $batPath

$ap = Get-SPTrustedIdentityTokenIssuer | where {$_.Name -eq "SocialConnekt"  }
if($ap) 
{$ap.Delete()}

Remove-SPTrustedRootAuthority -Identity "SocialConnekt Root Authority"